package com.itheimaoa.domain;

public class PageInfo {
	/* 当前页 */
	private int currentPage = 1;
	/* 每页显示的记录数 */
	private int pageSize = 10;
	/* 数据库查询开始记录 */
	private int firstIndex;

	private int barSum = 10;

	public PageInfo() {
		super();
	}
	public PageInfo(int firstIndex) {
		super();
		this.firstIndex = firstIndex;
	}

	public int getCurrentPage() {
		if (this.currentPage <= 0) {
			currentPage = 1;
		}
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		if (this.pageSize == 0) {
			this.pageSize = 10;
		}
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getBarSum() {
		if (this.barSum == 0) {
			this.barSum = 10;
		}
		return barSum;
	}

	public void setBarSum(int barSum) {
		this.barSum = barSum;
	}

	public int getFirstIndex() {
		if (currentPage < 1) {
			currentPage = 1;
		}
		this.firstIndex = (this.currentPage - 1) * this.pageSize;
		return firstIndex;
	}
}
